package com.deepocean.service.impl;

import com.deepocean.dao.CurvedScreenDao;
import com.deepocean.entity.*;
import com.deepocean.service.ICurvedScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class CurvedScreenServiceImpl implements ICurvedScreenService {
    @Autowired
    private CurvedScreenDao curvedScreenDao;

    @Override
    public boolean add(CurvedScreenEntity curvedScreenEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        curvedScreenEntity.setId(id);
        return curvedScreenDao.add(curvedScreenEntity);
    }

    @Override
    public CurvedScreenInAndOut1Hour getInAndOutInHour(String deviceId) {
        return curvedScreenDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<CurvedScreenEntity> getCurvedScreenByCondition(CurvedScreenCondition curvedScreenCondition) {
        return curvedScreenDao.getCurvedScreenByCondition(curvedScreenCondition);
    }
}
